package cn.zhaoyuening.fanblog.admin.utils;

/**
 * Created by Buynow on 2017/8/20.
 */
public class ResultObj {
    private Integer stauts;
    private String result;
    private Object msg;

    public static ResultObj getByResult(boolean result) {
        return result?ok():fail();
    }

    public static ResultObj ok() {
        return new ResultObj().setMsg("success").setStauts(200);
    }

    public static ResultObj fail() {
        return new ResultObj().setMsg("error").setStauts(400);
    }

    public Integer getStauts() {
        return stauts;
    }

    public ResultObj setStauts(Integer stauts) {
        this.stauts = stauts;
        return this;
    }

    public String getResult() {
        return result;
    }

    public ResultObj setResult(String result) {
        this.result = result;
        return this;
    }

    public Object getMsg() {
        return msg;
    }

    public ResultObj setMsg(Object msg) {
        this.msg = msg;
        return this;
    }
}
